<template>
  <div>
    <div class="flex flex-a-c headerBox" @click="gotoThat">
      <div class="title">产量统计</div>
      <a-icon type="right" />
    </div>
    <div class=" lightBox production" style="height:380px">
      <lineChart
        v-if="chartDatalineobj.expectedData.length > 0"
        :chart-data="chartData"
        :className="'ProducStatistics'"
        :legendShow="false"
        :height="'330px'"
        :str="'个'"
      ></lineChart>
      <a-empty style="margin-top:100px" v-else />
    </div>
  </div>
</template>

<script>
import lineChart from "./lineChart.vue";

export default {
  name: "index",
  props: {
    chartDatalineobj: {
      type: Object,
      default: () => {}
    }
  },
  components: {
    lineChart
  },
  data() {
    return {
      //   chartData: {
      //     expectedData: [],
      //     date: [],
      //     name:[]},
    };
  },
  // watch: {
  //   chartDatalineobj(val) {
  //     console.log('^^^^^^^^^^^^^^^^^^^^^');
  //     console.log(val);
  //     this.chartData.expectedData.push(val.expectedData)
  //     this.chartData.date.push(val.date)
  //     this.chartData.name.push('产量')
  //     // this.chartDatalinein(val);
  //   },
  // },
  computed: {
    chartData: function() {
      // let data={
      //   expectedData: [],
      //   date: [],
      //   name:[]
      // }
      // data.expectedData.push(this.chartDatalineobj.expectedData);
      // data.date=this.chartDatalineobj.date;
      return this.chartDatalineobj;
    }
  },
  created() {},
  methods: {
    gotoThat() {
      this.$store.commit("board/HeadNavType", 2);
      localStorage.setItem("navType", 2);
      this.$router.push("/statistics");
    }
  }
};
</script>

<style scoped lang="less">
.headerBox {
  margin: 20px 0 10px 0;
  .title {
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 4px 0 0;
  }
}
.lightBox {
  width: 100%;
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
}
</style>
